//
//  YJDataStateView.m
//  Safflower
//
//  Created by 袁亮 on 2016/12/20.
//  Copyright © 2016年 Migic_Z. All rights reserved.
//

#import "YJDataStateView.h"

@interface YJDataStateView()

@property (nonatomic, strong) UILabel *titleLabel;

@end

@implementation YJDataStateView

+ (YJDataStateView *)sharedStateView
{
    static YJDataStateView *stateView = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        stateView = [[self alloc]init];
    });
    return stateView;
}

- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.frame = CGRectMake(0, 0, SCREEN_WIDTH, 50);


        [self makeStateView];
   
    }
    return self;
}

- (void)makeStateView
{
    _titleLabel = [UILabel new];
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = [UIColor blackColor];
    _titleLabel.font = [UIFont systemFontOfSize:16.0f];
    [self addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.right.mas_equalTo(0);
    }];
}

- (UIView *)showStateWithTitle:(NSString *)title
{
    _titleLabel.text = title;
    return self;
}


@end
